from threading import Timer

def printA():
    print('A')

def printB():
    print('B')

def registerTask(sec, fn):
    t = Timer(sec, fn, None)
    t.start()

# 3s后执行
registerTask(3, printA)
registerTask(3, printB)